<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QStyleOptionTab Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QStyleOptionTab Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QStyleOptionTab class is used to describe the parameters for
drawing a tab bar. <a href="#details">More...</a></p>

<p>Inherits <a href="qstyleoption.html">QStyleOption</a>.</p><p>Inherited by <a href="qstyleoptiontabv2.html">QStyleOptionTabV2</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qstyleoptiontab.html#CornerWidget-enum">CornerWidget</a></b> { NoCornerWidgets, LeftCornerWidget, RightCornerWidget }</li><li><div class="fn" />class <b><a href="qstyleoptiontab-cornerwidgets.html">CornerWidgets</a></b></li><li><div class="fn" />enum <b><a href="qstyleoptiontab.html#SelectedPosition-enum">SelectedPosition</a></b> { NotAdjacent, NextIsSelected, PreviousIsSelected }</li><li><div class="fn" />enum <b><a href="qstyleoptiontab.html#StyleOptionType-enum">StyleOptionType</a></b> { Type }</li><li><div class="fn" />enum <b><a href="qstyleoptiontab.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</li><li><div class="fn" />enum <b><a href="qstyleoptiontab.html#TabPosition-enum">TabPosition</a></b> { Beginning, Middle, End, OnlyOneTab }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qstyleoptiontab.html#QStyleOptionTab">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qstyleoptiontab.html#QStyleOptionTab-2">__init__</a></b> (<i>self</i>, QStyleOptionTab&#160;<i>other</i>)</li></ul><h3>Members</h3><ul><li><div class="fn" />CornerWidgets <b><a href="qstyleoptiontab.html#cornerWidgets-var">cornerWidgets</a></b></li><li><div class="fn" />QIcon <b><a href="qstyleoptiontab.html#icon-var">icon</a></b></li><li><div class="fn" />TabPosition <b><a href="qstyleoptiontab.html#position-var">position</a></b></li><li><div class="fn" />int <b><a href="qstyleoptiontab.html#row-var">row</a></b></li><li><div class="fn" />SelectedPosition <b><a href="qstyleoptiontab.html#selectedPosition-var">selectedPosition</a></b></li><li><div class="fn" />QTabBar.Shape <b><a href="qstyleoptiontab.html#shape-var">shape</a></b></li><li><div class="fn" />QString <b><a href="qstyleoptiontab.html#text-var">text</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QStyleOptionTab class is used to describe the parameters for
drawing a tab bar.</p>
<p>The QStyleOptionTab class is used for drawing several built-in
Qt widgets including <a href="qtabbar.html">QTabBar</a> and the
panel for <a href="qtabwidget.html">QTabWidget</a>. Note that to
describe the parameters necessary for drawing a frame in Qt 4.1 or
above, you must use the <a href="qstyleoptionframev2.html">QStyleOptionFrameV2</a> subclass.</p>
<p>An instance of the QStyleOptiontabV2 class has <a href="qstyleoption.html#type-varx">type</a> <a href="qstyleoption.html#OptionType-enum">SO_Tab</a> and <a href="qstyleoption.html#version-var">version</a> 1. The type is used
internally by <a href="qstyleoption.html">QStyleOption</a>, its
subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to
determine the type of style option. In general you do not need to
worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own styles.
The version is used by <a href="qstyleoption.html">QStyleOption</a>
subclasses to implement extensions without breaking compatibility.
If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you
normally do not need to check it.</p>
<p>If you create your own <a href="qstyle.html">QStyle</a>
subclass, you should handle both QStyleOptionTab and <a href="qstyleoptiontabv2.html">QStyleOptionTabV2</a>.</p>
<p>For an example demonstrating how style options can be used, see
the <a href="widgets-styles.html">Styles</a> example.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="CornerWidget-enum" />QStyleOptionTab.CornerWidget</h3><p>These flags indicate the corner widgets in a tab.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.NoCornerWidgets</tt></td>
<td class="topAlign"><tt>0x00</tt></td>
<td class="topAlign">There are no corner widgets</td>
</tr>
<tr>
<td class="topAlign">
<tt>QStyleOptionTab.LeftCornerWidget</tt></td>
<td class="topAlign"><tt>0x01</tt></td>
<td class="topAlign">Left corner widget</td>
</tr>
<tr>
<td class="topAlign">
<tt>QStyleOptionTab.RightCornerWidget</tt></td>
<td class="topAlign"><tt>0x02</tt></td>
<td class="topAlign">Right corner widget</td>
</tr>
</table>
<p>The CornerWidgets type is a typedef for <a href="qflags.html">QFlags</a>&lt;CornerWidget&gt;. It stores an OR
combination of CornerWidget values.</p>
<p><b>See also</b> <a href="qstyleoptiontab.html#cornerWidgets-var">cornerWidgets</a>.</p>


<h3 class="fn"><a name="SelectedPosition-enum" />QStyleOptionTab.SelectedPosition</h3><p>This enum describes the position of the selected tab. Some
styles need to draw a tab differently depending on whether or not
it is adjacent to the selected tab.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.NotAdjacent</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The tab is not adjacent to a selected tab (or
is the selected tab).</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.NextIsSelected</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The next tab (typically the tab on the right)
is selected.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QStyleOptionTab.PreviousIsSelected</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The previous tab (typically the tab on the
left) is selected.</td>
</tr>
</table>
<p><b>See also</b> <a href="qstyleoptiontab.html#selectedPosition-var">selectedPosition</a>.</p>


<h3 class="fn"><a name="StyleOptionType-enum" />QStyleOptionTab.StyleOptionType</h3><p>This enum is used to hold information about the type of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.Type</tt></td>
<td class="topAlign"><tt>SO_Tab</tt></td>
<td class="topAlign">The type of style option provided (<a href="qstyleoption.html#OptionType-enum">SO_Tab</a> for this
class).</td>
</tr>
</table>
<p>The type is used internally by <a href="qstyleoption.html">QStyleOption</a>, its subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to
determine the type of style option. In general you do not need to
worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own
styles.</p>
<p><b>See also</b> <a href="qstyleoptiontab.html#StyleOptionVersion-enum">StyleOptionVersion</a>.</p>


<h3 class="fn"><a name="StyleOptionVersion-enum" />QStyleOptionTab.StyleOptionVersion</h3><p>This enum is used to hold information about the version of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.Version</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">1</td>
</tr>
</table>
<p>The version is used by <a href="qstyleoption.html">QStyleOption</a> subclasses to implement
extensions without breaking compatibility. If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you
normally do not need to check it.</p>
<p><b>See also</b> <a href="qstyleoptiontab.html#StyleOptionType-enum">StyleOptionType</a>.</p>


<h3 class="fn"><a name="TabPosition-enum" />QStyleOptionTab.TabPosition</h3><p>This enum describes the position of the tab.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.Beginning</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The tab is the first tab in the tab bar.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.Middle</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The tab is neither the first nor the last tab
in the tab bar.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.End</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The tab is the last tab in the tab bar.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionTab.OnlyOneTab</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The tab is both the first and the last tab in
the tab bar.</td>
</tr>
</table>
<p><b>See also</b> <a href="qstyleoptiontab.html#position-var">position</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QStyleOptionTab" />QStyleOptionTab.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qstyleoptiontab.html">QStyleOptionTab</a>
object, initializing the members variables to their default
values.</p>


<h3 class="fn"><a name="QStyleOptionTab-2" />QStyleOptionTab.__init__ (<i>self</i>, <a href="qstyleoptiontab.html">QStyleOptionTab</a>&#160;<i>other</i>)</h3><p>Constructs a copy of the <i>other</i> style option.</p>
<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="cornerWidgets-var" /><a href="qstyleoptiontab-cornerwidgets.html">CornerWidgets</a> cornerWidgets</h3><p>This variable holds an OR combination of CornerWidget values
indicating the corner widgets of the tab bar.</p>
<p>The default value is <a href="qstyleoptiontab.html#CornerWidget-enum">NoCornerWidgets</a>.</p>
<p><b>See also</b> <a href="qstyleoptiontab.html#CornerWidget-enum">CornerWidget</a>.</p>


<h3 class="fn"><a name="icon-var" /><a href="qicon.html">QIcon</a> icon</h3><p>This variable holds the icon for the tab.</p>
<p>The default value is an empty icon, i.e. an icon with neither a
pixmap nor a filename.</p>


<h3 class="fn"><a name="position-var" /><a href="qstyleoptiontab.html#TabPosition-enum">TabPosition</a> position</h3><p>This variable holds the position of the tab in the tab bar.</p>
<p>The default value is <a href="qstyleoptiontab.html#TabPosition-enum">Beginning</a>, i.e. the tab
is the first tab in the tab bar.</p>


<h3 class="fn"><a name="row-var" />int row</h3><p>This variable holds which row the tab is currently in.</p>
<p>The default value is 0, indicating the front row. Currently this
property can only be 0.</p>


<h3 class="fn"><a name="selectedPosition-var" /><a href="qstyleoptiontab.html#SelectedPosition-enum">SelectedPosition</a> selectedPosition</h3><p>This variable holds the position of the selected tab in relation
to this tab.</p>
<p>The default value is <a href="qstyleoptiontab.html#SelectedPosition-enum">NotAdjacent</a>, i.e.
the tab is not adjacent to a selected tab nor is it the selected
tab.</p>


<h3 class="fn"><a name="shape-var" /><a href="qtabbar.html#Shape-enum">QTabBar.Shape</a> shape</h3><p>This variable holds the tab shape used to draw the tab; by
default QTabBar.RoundedNorth.</p>
<p><b>See also</b> <a href="qtabbar.html#Shape-enum">QTabBar.Shape</a>.</p>


<h3 class="fn"><a name="text-var" />QString text</h3><p>This variable holds the text of the tab.</p>
<p>The default value is an empty string.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>